package me.littlesquid.bettertp;

import org.bukkit.entity.Player;
import me.littlesquid.bettertp.compass;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.inventory.ItemStack;

public class UseEvent implements Listener {
    @EventHandler
    public void onCompassUse(PlayerInteractEvent event){
        Player player=event.getPlayer();
        if(event.hasItem()){
            ItemStack itemStack=event.getItem();
            ItemStack compass= me.littlesquid.bettertp.compass.getcompass();
            if(itemStack.equals(compass)){
                player.openInventory(gui.open());
            }
        }
    }
}
